home *** CD-ROM | disk | FTP | other *** search
- /* An Arexx script for use with AmiSlate:
-
- Draws that "diamond out of straight lines" design that
- was so nifty in elementary school ;-)
-
- */
- parse arg CommandPort ActiveString
-
- address (CommandPort)
- options results
-
- /* Calculate center of drawing area */
- GetWindowAttrs stem win.
- mx = trunc((win.width-58)/2)
- my = trunc((win.height-53)/2)
- tx = mx * 2
- ty = my * 2
-
- /* Get user's current foreground color */
- GetStateAttrs stem state.
- SetFPen state.fpen /* copy it to our color */
-
- x = 0
- y = 0
-
- StringRequest stem message. '"'||"Diamond Request"||'"' 15 '"'||"How many partitions in the diamond?"||'"'
- numberofpartitions = message.message
- xstep = trunc((mx * 2) / numberofpartitions)
- ystep = trunc((my * 2) / numberofpartitions)
-
- /* upper left quadrant */
- x = 0
- y = my
- do while (y <= my)
- line x my mx y
- line x (ty - my) mx (ty - y)
- x = x + xstep
- y = y - ystep
- if (y <= 0) then ystep = -abs(ystep)
- end